package com.cloudcreativity.cashiersystem.entity;

import android.text.TextUtils;

import com.cloudcreativity.cashiersystem.utils.StrUtils;

import java.util.List;

public class MemberEntity {
    private long id;
    private String mobile;
    private String registerTime;
    private String avatar;
    private String balance;
    private String score;
    private String sex;
    private String age;
    private String career;
    private long provinceId;
    private long cityId;
    private long areaId;
    private String villageName;
    private int identity;
    private String discountAbility;
    private int level;
    private String wxName;
    private String wxAvatar;
    private String wxAddress;
    private String wxOpenid;
    private String updateTime;
    private long shopId;
    private String shopName;
    private String type;
    private long adminId;

    private int maxPayMoney;
    private int minPayMoney;
    private int avgPayMoney;
    private int monthAmount;
    private int weekAmount;
    private List<Category> categoryOneAmount;

    public String formatMax(){
        return "￥"+StrUtils.get2BitDecimal(maxPayMoney/100f);
    }

    public String formatMin(){
        return "￥"+StrUtils.get2BitDecimal(minPayMoney/100f);
    }

    public String formatAvg(){
        return "￥"+StrUtils.get2BitDecimal(avgPayMoney/100f);
    }

    public int getMaxPayMoney() {
        return maxPayMoney;
    }

    public void setMaxPayMoney(int maxPayMoney) {
        this.maxPayMoney = maxPayMoney;
    }

    public int getMinPayMoney() {
        return minPayMoney;
    }

    public void setMinPayMoney(int minPayMoney) {
        this.minPayMoney = minPayMoney;
    }

    public int getAvgPayMoney() {
        return avgPayMoney;
    }

    public void setAvgPayMoney(int avgPayMoney) {
        this.avgPayMoney = avgPayMoney;
    }

    public int getMonthAmount() {
        return monthAmount;
    }

    public void setMonthAmount(int monthAmount) {
        this.monthAmount = monthAmount;
    }

    public int getWeekAmount() {
        return weekAmount;
    }

    public void setWeekAmount(int weekAmount) {
        this.weekAmount = weekAmount;
    }

    public List<Category> getCategoryOneAmount() {
        return categoryOneAmount;
    }

    public void setCategoryOneAmount(List<Category> categoryOneAmount) {
        this.categoryOneAmount = categoryOneAmount;
    }

    public String formatScore(){
        return TextUtils.isEmpty(this.score)?"0":String.valueOf(this.score);
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(String registerTime) {
        this.registerTime = registerTime;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getBalance() {
        return balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getCareer() {
        return career;
    }

    public void setCareer(String career) {
        this.career = career;
    }

    public long getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(long provinceId) {
        this.provinceId = provinceId;
    }

    public long getCityId() {
        return cityId;
    }

    public void setCityId(long cityId) {
        this.cityId = cityId;
    }

    public long getAreaId() {
        return areaId;
    }

    public void setAreaId(long areaId) {
        this.areaId = areaId;
    }

    public String getVillageName() {
        return villageName;
    }

    public void setVillageName(String villageName) {
        this.villageName = villageName;
    }

    public int getIdentity() {
        return identity;
    }

    public void setIdentity(int identity) {
        this.identity = identity;
    }

    public String getDiscountAbility() {
        return discountAbility;
    }

    public void setDiscountAbility(String discountAbility) {
        this.discountAbility = discountAbility;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getWxName() {
        return wxName;
    }

    public void setWxName(String wxName) {
        this.wxName = wxName;
    }

    public String getWxAvatar() {
        return wxAvatar;
    }

    public void setWxAvatar(String wxAvatar) {
        this.wxAvatar = wxAvatar;
    }

    public String getWxAddress() {
        return wxAddress;
    }

    public void setWxAddress(String wxAddress) {
        this.wxAddress = wxAddress;
    }

    public String getWxOpenid() {
        return wxOpenid;
    }

    public void setWxOpenid(String wxOpenid) {
        this.wxOpenid = wxOpenid;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public long getShopId() {
        return shopId;
    }

    public void setShopId(long shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public long getAdminId() {
        return adminId;
    }

    public void setAdminId(long adminId) {
        this.adminId = adminId;
    }

    public String formatType() {
        return this.identity == 1 ? "家庭会员" : "VIP会员";
    }

    public String formatLevel() {
        switch (this.level) {
            case 1:
                return "普通会员";
            case 2:
                return "银牌会员";
            case 3:
                return "金牌会员";
            case 4:
                return "钻石会员";
            default:
                return "普通会员";
        }
    }

    public String formatBalance(){
        return TextUtils.isEmpty(this.balance)?"￥0.00":("￥"+StrUtils.get2BitDecimal(Float.parseFloat(this.balance)/100f));
    }

    public static class Category{
        private int category;
        private String categoryName;
        private String categoryOneId;
        private String color;

        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

        public int getCategory() {
            return category;
        }

        public void setCategory(int category) {
            this.category = category;
        }

        public String getCategoryName() {
            return categoryName;
        }

        public void setCategoryName(String categoryName) {
            this.categoryName = categoryName;
        }

        public String getCategoryOneId() {
            return categoryOneId;
        }

        public void setCategoryOneId(String categoryOneId) {
            this.categoryOneId = categoryOneId;
        }
    }
}
